<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>


<%
String path = request.getContextPath();
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<script language="JavaScript" type="text/JavaScript" charset="utf-8"> 
			var rootPath = "<%=path%>"; 
		</script>
		<title>Dept Tree</title>
		<link rel="stylesheet" type="text/css" href="../../../tree/function.css"
			charset="utf-8">
		<link rel="stylesheet" type="text/css" href="../../../css/sideR.css"
			charset="utf-8">
			<link href="<%=path%>/css/main.css" type="text/css" rel="stylesheet"/>	
		
		<script language="JavaScript" src="../../../js/jquery-1.3.1.min.js"
			type="text/JavaScript" charset="utf-8"></script>
		<script language="JavaScript" src="../../../tree/rtree.js"
			type="text/JavaScript" charset="utf-8"></script>
		<script language="JavaScript" src="../../../tree/dtreeImpl.js"
			type="text/JavaScript" charset="utf-8"></script>
	</head>

	<body style="background-color:#F3F7F8;margin:0 0 0 0">
		<f:view>
			<h:form id="dFrom">
				<h:inputHidden id="items" value="#{roleBean.dtree}"></h:inputHidden>
				<table style="border:1px solid #F3F7F8;table-layout:fixed" cellpadding="0" cellspacing="0" width="100%">
					<tr>
						<td height="340px" valign="top">
							<div id="main_Tree_DIV"></div>
						</td>
					</tr>
					<tr>
						<td height="30px"style="border-top:1px solid #CCFFFF;border-bottom:1px solid #CCFFFF;">
							&nbsp;&nbsp;
							<input type="button" value=" 确 定 " onclick="checkedValue();" class="but1" />
							&nbsp;&nbsp;&nbsp;&nbsp;
							<input type="button" value=" 关 闭 " onclick="window.close();" class="but1"/>
						</td>
					</tr>
				</table>
			</h:form>
		</f:view>
	</body>
</html>
<script language="JavaScript" type="text/JavaScript" charset="utf-8"> 
		var rootPath = "<%=path%>";
		var treeJson = eval("("+$("#dFrom\\:items").val()+")");
		var params = window.dialogArguments;
		var r=new rTree("r");
		r.setNodedbc(true);
		r.setNodehref(false);
		r.setLazy(false);
		r.canAlterbg(true);
		r.ischeckbox = true;		
		r.ischecked = params._ischeck;
		r.leafSelctDefault = params.param;
		r.isSingle = false;
		r.leafSelect = true;
		r.leafOptions = ['浏览','管理']; //r.leafSelect = true时 才能赋值
		//leafSelect:是否有下拉列表，r.add('id','name','pid',n),选中leafOptions[n]
		
		r.add("0","-1","根");
		for(var i=0;i<treeJson.length;i++){		 
			r.add(treeJson[i][0],treeJson[i][2],treeJson[i][1],treeJson[i][3]);
		}
		r.startTree(); 
</script>
